<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改合同')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-contract-edit" th:object="${tContract}">
        <input name="contractId" th:field="*{contractId}" type="hidden">
        <div class="form-group">
            <label class="col-sm-3 control-label">合同编号：</label>
            <div class="col-sm-8">
                <input name="contractNum" th:field="*{contractNum}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">合同名称：</label>
            <div class="col-sm-8">
                <input name="contractName" th:field="*{contractName}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">销售订单编号：</label>
            <div class="col-sm-8">
                <select name="purchaseId" class="form-control m-b">
                    <option selected hidden value="">-请选择销售编号-</option>
                    <option th:each="dict : ${tSales}" th:value="${dict.salesId}"  th:text="${dict.salesNum}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">卖方：</label>
            <div class="col-sm-8">
                <select name="contractSeller" class="form-control m-b">
                    <option selected hidden value="">-请选择销售人员-</option>
                    <option th:each="dict : ${sysUsers}" th:value="${dict.userName}"  th:text="${dict.userName}"  th:field="*{contractSeller}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">买方：</label>
            <div class="col-sm-8">
                <select name="contractBuyer" class="form-control m-b">
                    <option selected hidden value="">-请选择客户-</option>
                    <option th:each="dict : ${tPurchases}" th:value="${dict.purchaseName}"  th:text="${dict.purchaseName}" th:field="*{contractBuyer}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">卖方身份证号：</label>
            <div class="col-sm-8">
                <input name="contractSellerCid" th:field="*{contractSellerCid}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">买方身份证号：</label>
            <div class="col-sm-8">
                <input name="contractBuyerCid" th:field="*{contractBuyerCid}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">房子位置：</label>
            <div class="col-sm-8">
                <input name="contractPosition" th:field="*{contractPosition}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">房子面积：</label>
            <div class="col-sm-8">
                <input name="contractArea" th:field="*{contractArea}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">每平方米价格：</label>
            <div class="col-sm-8">
                <input name="contractPriceSquare" th:field="*{contractPriceSquare}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">大写价格：</label>
            <div class="col-sm-8">
                <input name="contractCapitalPrice" th:field="*{contractCapitalPrice}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">小写价格：</label>
            <div class="col-sm-8">
                <input name="contractPriceInFigures" th:field="*{contractPriceInFigures}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">房产名字更改：</label>
            <div class="col-sm-8">
                <input name="contractPriceName" th:field="*{contractPriceName}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">违约金：</label>
            <div class="col-sm-8">
                <input name="contractBreachOfContract" th:field="*{contractBreachOfContract}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">其它约定：</label>
            <div class="col-sm-8">
                <input name="contractOther" th:field="*{contractOther}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">卖方地址：</label>
            <div class="col-sm-8">
                <input name="contractSellerAddres" th:field="*{contractSellerAddres}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">卖方手机号：</label>
            <div class="col-sm-8">
                <input name="contractSellerPhone" th:field="*{contractSellerPhone}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">买方地址：</label>
            <div class="col-sm-8">
                <input name="contractBuyerAddres" th:field="*{contractBuyerAddres}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">买方手机号：</label>
            <div class="col-sm-8">
                <input name="contractBuyerPhone" th:field="*{contractBuyerPhone}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">签订时间：</label>
            <div class="col-sm-8">
                <div class="input-group date">
                    <input name="contractDate"  th:field="*{contractDate}" class="form-control" placeholder="yyyy-MM-dd HH:mm:ss" type="text">
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">付款时间（几日内）：</label>
            <div class="col-sm-8">
                    <input name="contractPricePayDate"  th:field="*{contractPricePayDate}" class="form-control" placeholder="付款时间（几日内）" type="text">
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
    var prefix = ctx + "system/contract";
    $("#form-contract-edit").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-contract-edit').serialize());
        }
    }

    $("input[name='contractDate']").datetimepicker({
        format: "yyyy-mm-dd  HH:mm:ss",
        minView: "month",
        autoclose: true
    });

</script>
</body>
</html>